package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	var a string
	fmt.Println("按任意键进行抽取，按'q'结束")
	fmt.Scan(&a)
	lst := []string{"A", "B", "C", "D"}
	for a != "q" {
		test(lst)
		fmt.Scan(&a)
	}
	if a == "q" {
		fmt.Println("退出成功！")
	}
}

func test(lst []string) {
	rand.Seed(time.Now().UnixNano())
	t := rand.Intn(len(lst))
	fmt.Println("被抽到的人是：", lst[t])
	lst = append(lst[:t], lst[t+1:]...)
}
